00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __pspgu_h__
00010 #define __pspgu_h__
00011
00012 #include <psptypes.h>
00013 #include <pspge.h>
00014
00019 #if defined(__cplusplus)
00020 extern "C" {
00021 #endif
00022
00023
00024 #define GU_PI (3.141593f)
00025
00026
00027 #define GU_FALSE (0)
00028 #define GU_TRUE (1)
00029
00030
00031 #define GU_POINTS (0)
00032 #define GU_LINES (1)
00033 #define GU_LINE_STRIP (2)
00034 #define GU_TRIANGLES (3)
00035 #define GU_TRIANGLE_STRIP (4)
00036 #define GU_TRIANGLE_FAN (5)
00037 #define GU_SPRITES (6)
00038
00039
00040 #define GU_ALPHA_TEST (0)
00041 #define GU_DEPTH_TEST (1)
00042 #define GU_SCISSOR_TEST (2)
00043 #define GU_STENCIL_TEST (3)
00044 #define GU_BLEND (4)
00045 #define GU_CULL_FACE (5)
00046 #define GU_DITHER (6)
00047 #define GU_FOG (7)
00048 #define GU_CLIP_PLANES (8)
00049 #define GU_TEXTURE_2D (9)
00050 #define GU_LIGHTING (10)
00051 #define GU_LIGHT0 (11)
00052 #define GU_LIGHT1 (12)
00053 #define GU_LIGHT2 (13)
00054 #define GU_LIGHT3 (14)
00055 #define GU_LINE_SMOOTH (15)
00056 #define GU_PATCH_CULL_FACE (16)
00057 #define GU_COLOR_TEST (17)
00058 #define GU_COLOR_LOGIC_OP (18)
00059 #define GU_FACE_NORMAL_REVERSE (19)
00060 #define GU_PATCH_FACE (20)
00061 #define GU_FRAGMENT_2X (21)
00062
00063
00064 #define GU_PROJECTION (0)
00065 #define GU_VIEW (1)
00066 #define GU_MODEL (2)
00067 #define GU_TEXTURE (3)
00068
00069
00070 #define GU_TEXTURE_SHIFT(n) ((n)<<0)
00071 #define GU_TEXTURE_8BIT GU_TEXTURE_SHIFT(1)
00072 #define GU_TEXTURE_16BIT GU_TEXTURE_SHIFT(2)
00073 #define GU_TEXTURE_32BITF GU_TEXTURE_SHIFT(3)
00074 #define GU_TEXTURE_BITS GU_TEXTURE_SHIFT(3)
00075
00076 #define GU_COLOR_SHIFT(n) ((n)<<2)
00077 #define GU_COLOR_RES1 GU_COLOR_SHIFT(1)
00078 #define GU_COLOR_RES2 GU_COLOR_SHIFT(2)
00079 #define GU_COLOR_RES3 GU_COLOR_SHIFT(3)
00080 #define GU_COLOR_5650 GU_COLOR_SHIFT(4)
00081 #define GU_COLOR_5551 GU_COLOR_SHIFT(5)
00082 #define GU_COLOR_4444 GU_COLOR_SHIFT(6)
00083 #define GU_COLOR_8888 GU_COLOR_SHIFT(7)
00084 #define GU_COLOR_BITS GU_COLOR_SHIFT(7)
00085
00086 #define GU_NORMAL_SHIFT(n) ((n)<<5)
00087 #define GU_NORMAL_8BIT GU_NORMAL_SHIFT(1)
00088 #define GU_NORMAL_16BIT GU_NORMAL_SHIFT(2)
00089 #define GU_NORMAL_32BITF GU_NORMAL_SHIFT(3)
00090 #define GU_NORMAL_BITS GU_NORMAL_SHIFT(3)
00091
00092 #define GU_VERTEX_SHIFT(n) ((n)<<7)
00093 #define GU_VERTEX_8BIT GU_VERTEX_SHIFT(1)
00094 #define GU_VERTEX_16BIT GU_VERTEX_SHIFT(2)
00095 #define GU_VERTEX_32BITF GU_VERTEX_SHIFT(3)
00096 #define GU_VERTEX_BITS GU_VERTEX_SHIFT(3)
00097
00098 #define GU_WEIGHT_SHIFT(n) ((n)<<9)
00099 #define GU_WEIGHT_8BIT GU_WEIGHT_SHIFT(1)
00100 #define GU_WEIGHT_16BIT GU_WEIGHT_SHIFT(2)
00101 #define GU_WEIGHT_32BITF GU_WEIGHT_SHIFT(3)
00102 #define GU_WEIGHT_BITS GU_WEIGHT_SHIFT(3)
00103
00104 #define GU_INDEX_SHIFT(n) ((n)<<11)
00105 #define GU_INDEX_8BIT GU_INDEX_SHIFT(1)
00106 #define GU_INDEX_16BIT GU_INDEX_SHIFT(2)
00107 #define GU_INDEX_BITS GU_INDEX_SHIFT(3)
00108
00109 #define GU_WEIGHTS(n) ((((n)-1)&7)<<14)
00110 #define GU_WEIGHTS_BITS GU_WEIGHTS(8)
00111 #define GU_VERTICES(n) ((((n)-1)&7)<<18)
00112 #define GU_VERTICES_BITS GU_VERTICES(8)
00113
00114 #define GU_TRANSFORM_SHIFT(n) ((n)<<23)
00115 #define GU_TRANSFORM_3D GU_TRANSFORM_SHIFT(0)
00116 #define GU_TRANSFORM_2D GU_TRANSFORM_SHIFT(1)
00117 #define GU_TRANSFORM_BITS GU_TRANSFORM_SHIFT(1)
00118
00119
00120
00121 #define GU_PSM_5650 (0)
00122 #define GU_PSM_5551 (1)
00123 #define GU_PSM_4444 (2)
00124 #define GU_PSM_8888 (3)
00125 #define GU_PSM_T4 (4)
00126 #define GU_PSM_T8 (5)
00127 #define GU_PSM_T16 (6)
00128 #define GU_PSM_T32 (7)
00129 #define GU_PSM_DXT1 (8)
00130 #define GU_PSM_DXT3 (9)
00131 #define GU_PSM_DXT5 (10)
00132
00133
00134 #define GU_FLAT (0)
00135 #define GU_SMOOTH (1)
00136
00137
00138 #define GU_CLEAR (0)
00139 #define GU_AND (1)
00140 #define GU_AND_REVERSE (2)
00141 #define GU_COPY (3)
00142 #define GU_AND_INVERTED (4)
00143 #define GU_NOOP (5)
00144 #define GU_XOR (6)
00145 #define GU_OR (7)
00146 #define GU_NOR (8)
00147 #define GU_EQUIV (9)
00148 #define GU_INVERTED (10)
00149 #define GU_OR_REVERSE (11)
00150 #define GU_COPY_INVERTED (12)
00151 #define GU_OR_INVERTED (13)
00152 #define GU_NAND (14)
00153 #define GU_SET (15)
00154
00155
00156 #define GU_NEAREST (0)
00157 #define GU_LINEAR (1)
00158 #define GU_NEAREST_MIPMAP_NEAREST (4)
00159 #define GU_LINEAR_MIPMAP_NEAREST (5)
00160 #define GU_NEAREST_MIPMAP_LINEAR (6)
00161 #define GU_LINEAR_MIPMAP_LINEAR (7)
00162
00163
00164 #define GU_TEXTURE_COORDS (0)
00165 #define GU_TEXTURE_MATRIX (1)
00166 #define GU_ENVIRONMENT_MAP (2)
00167
00168
00169 #define GU_POSITION (0)
00170 #define GU_UV (1)
00171 #define GU_NORMALIZED_NORMAL (2)
00172 #define GU_NORMAL (3)
00173
00174
00175 #define GU_REPEAT (0)
00176 #define GU_CLAMP (1)
00177
00178
00179 #define GU_CW (0)
00180 #define GU_CCW (1)
00181
00182
00183 #define GU_NEVER (0)
00184 #define GU_ALWAYS (1)
00185 #define GU_EQUAL (2)
00186 #define GU_NOTEQUAL (3)
00187 #define GU_LESS (4)
00188 #define GU_LEQUAL (5)
00189 #define GU_GREATER (6)
00190 #define GU_GEQUAL (7)
00191
00192
00193 #define GU_COLOR_BUFFER_BIT (1)
00194 #define GU_STENCIL_BUFFER_BIT (2)
00195 #define GU_DEPTH_BUFFER_BIT (4)
00196 #define GU_FAST_CLEAR_BIT (16)
00197
00198
00199 #define GU_TFX_MODULATE (0)
00200 #define GU_TFX_DECAL (1)
00201 #define GU_TFX_BLEND (2)
00202 #define GU_TFX_REPLACE (3)
00203 #define GU_TFX_ADD (4)
00204
00205
00206 #define GU_TCC_RGB (0)
00207 #define GU_TCC_RGBA (1)
00208
00209
00210 #define GU_ADD (0)
00211 #define GU_SUBTRACT (1)
00212 #define GU_REVERSE_SUBTRACT (2)
00213 #define GU_MIN (3)
00214 #define GU_MAX (4)
00215 #define GU_ABS (5)
00216
00217
00218 #define GU_SRC_COLOR (0)
00219 #define GU_ONE_MINUS_SRC_COLOR (1)
00220 #define GU_SRC_ALPHA (2)
00221 #define GU_ONE_MINUS_SRC_ALPHA (3)
00222 #define GU_DST_COLOR (0)
00223 #define GU_ONE_MINUS_DST_COLOR (1)
00224 #define GU_DST_ALPHA (4)
00225 #define GU_ONE_MINUS_DST_ALPHA (5)
00226 #define GU_FIX (10)
00227
00228
00229 #define GU_KEEP (0)
00230 #define GU_ZERO (1)
00231 #define GU_REPLACE (2)
00232 #define GU_INVERT (3)
00233 #define GU_INCR (4)
00234 #define GU_DECR (5)
00235
00236
00237 #define GU_AMBIENT (1)
00238 #define GU_DIFFUSE (2)
00239 #define GU_SPECULAR (4)
00240 #define GU_AMBIENT_AND_DIFFUSE (GU_AMBIENT|GU_DIFFUSE)
00241 #define GU_DIFFUSE_AND_SPECULAR (GU_DIFFUSE|GU_SPECULAR)
00242 #define GU_UNKNOWN_LIGHT_COMPONENT (8)
00243
00244
00245 #define GU_SINGLE_COLOR (0)
00246 #define GU_SEPARATE_SPECULAR_COLOR (1)
00247
00248
00249 #define GU_DIRECTIONAL (0)
00250 #define GU_POINTLIGHT (1)
00251 #define GU_SPOTLIGHT (2)
00252
00253
00254 #define GU_DIRECT (0)
00255 #define GU_CALL (1)
00256 #define GU_SEND (2)
00257
00258
00259 #define GU_TAIL (0)
00260 #define GU_HEAD (1)
00261
00262
00263 #define GU_CALLBACK_SIGNAL (1)
00264 #define GU_CALLBACK_FINISH (4)
00265
00266
00267 #define GU_BEHAVIOR_SUSPEND (1)
00268 #define GU_BEHAVIOR_CONTINUE (2)
00269
00270
00271 #define GU_ABGR(a,b,g,r) (((a) << 24)|((b) << 16)|((g) << 8)|(r))
00272 #define GU_ARGB(a,r,g,b) GU_ABGR((a),(b),(g),(r))
00273 #define GU_RGBA(r,g,b,a) GU_ARGB((a),(r),(g),(b))
00274
00275
00276 #define GU_COLOR(r,g,b,a) GU_RGBA((u32)((r) * 255.0f),(u32)((g) * 255.0f),(u32)((b) * 255.0f),(u32)((a) * 255.0f))
00277
00278 typedef void (*GuSwapBuffersCallback)(void** display,void** render);
00279
00282
00290 void sceGuDepthBuffer(void* zbp, int zbw);
00291
00306 void sceGuDispBuffer(int width, int height, void* dispbp, int dispbw);
00307
00326 void sceGuDrawBuffer(int psm, void* fbp, int fbw);
00327
00335 void sceGuDrawBufferList(int psm, void* fbp, int fbw);
00336
00347 int sceGuDisplay(int state);
00348
00364 void sceGuDepthFunc(int function);
00365
00371 void sceGuDepthMask(int mask);
00372
00373 void sceGuDepthOffset(unsigned int offset);
00374
00388 void sceGuDepthRange(int near, int far);
00389
00390 void sceGuFog(float near, float far, unsigned int color);
00391
00397 void sceGuInit(void);
00398
00404 void sceGuTerm(void);
00405
00406 void sceGuBreak(int a0);
00407 void sceGuContinue(void);
00408
00420 void* sceGuSetCallback(int signal, void (*callback)(int));
00421
00432 void sceGuSignal(int signal, int behavior);
00433
00442 void sceGuSendCommandf(int cmd, float argument);
00443
00452 void sceGuSendCommandi(int cmd, int argument);
00453
00464 void* sceGuGetMemory(int size);
00465
00479 void sceGuStart(int cid, void* list);
00480
00492 int sceGuFinish(void);
00493
00499 void sceGuCallList(const void* list);
00500
00507 void sceGuCallMode(int mode);
00508
00514 int sceGuCheckList(void);
00515
00527 void sceGuSendList(int mode, const void* list, PspGeContext* context);
00528
00534 void* sceGuSwapBuffers(void);
00535
00548 int sceGuSync(int mode, int a1);
00549
00616 void sceGuDrawArray(int prim, int vtype, int count, const void* indices, const void* vertices);
00617
00637 void sceGuBeginObject(int vtype, int count, const void* indices, const void* vertices);
00638
00642 void sceGuEndObject(void);
00643
00652 void sceGuSetStatus(int state, int status);
00653
00662 int sceGuGetStatus(int state);
00663
00671 void sceGuSetAllStatus(int status);
00672
00680 int sceGuGetAllStatus(void);
00681
00703 void sceGuEnable(int state);
00704
00712 void sceGuDisable(int state);
00713
00732 void sceGuLight(int light, int type, int components, const ScePspFVector3* position);
00733
00742 void sceGuLightAtt(int light, float atten0, float atten1, float atten2);
00743
00758 void sceGuLightColor(int light, int component, unsigned int color);
00759
00772 void sceGuLightMode(int mode);
00773
00782 void sceGuLightSpot(int light, const ScePspFVector3* direction, float exponent, float cutoff);
00783
00794 void sceGuClear(int flags);
00795
00801 void sceGuClearColor(unsigned int color);
00802
00808 void sceGuClearDepth(unsigned int depth);
00809
00816 void sceGuClearStencil(unsigned int stencil);
00817
00824 void sceGuPixelMask(unsigned int mask);
00825
00831 void sceGuColor(unsigned int color);
00832
00853 void sceGuColorFunc(int func, unsigned int color, unsigned int mask);
00854
00865 void sceGuColorMaterial(int components);
00866
00884 void sceGuAlphaFunc(int func, int value, int mask);
00885
00886 void sceGuAmbient(unsigned int color);
00887 void sceGuAmbientColor(unsigned int color);
00888
00923 void sceGuBlendFunc(int op, int src, int dest, unsigned int srcfix, unsigned int destfix);
00924
00925 void sceGuMaterial(int mode, int color);
00926
00930 void sceGuModelColor(unsigned int emissive, unsigned int ambient, unsigned int diffuse, unsigned int specular);
00931
00949 void sceGuStencilFunc(int func, int ref, int mask);
00950
00969 void sceGuStencilOp(int fail, int zfail, int zpass);
00970
00977 void sceGuSpecular(float power);
00978
00990 void sceGuFrontFace(int order);
00991
01017 void sceGuLogicalOp(int op);
01018
01026 void sceGuSetDither(const ScePspIMatrix4* matrix);
01027
01037 void sceGuShadeModel(int mode);
01038
01061 void sceGuCopyImage(int psm, int sx, int sy, int width, int height, int srcw, void* src, int dx, int dy, int destw, void* dest);
01062
01072 void sceGuTexEnvColor(unsigned int color);
01073
01088 void sceGuTexFilter(int min, int mag);
01089
01096 void sceGuTexFlush(void);
01097
01128 void sceGuTexFunc(int tfx, int tcc);
01129
01144 void sceGuTexImage(int mipmap, int width, int height, int tbw, const void* tbp);
01145 void sceGuTexLevelMode(unsigned int a0, float f12);
01146
01159 void sceGuTexMapMode(int mode, unsigned int a1, unsigned int a2);
01160
01177 void sceGuTexMode(int tpsm, int maxmips, int a2, int swizzle);
01178
01188 void sceGuTexOffset(float u, float v);
01189
01201 void sceGuTexProjMapMode(int mode);
01202
01212 void sceGuTexScale(float u, float v);
01213 void sceGuTexSlope(float slope);
01214
01221 void sceGuTexSync();
01222
01233 void sceGuTexWrap(int u, int v);
01234
01243 void sceGuClutLoad(int num_blocks, const void* cbp);
01244
01259 void sceGuClutMode(unsigned int cpsm, unsigned int a1, unsigned int a2, unsigned int a3);
01260
01274 void sceGuOffset(unsigned int x, unsigned int y);
01275
01286 void sceGuScissor(int x, int y, int w, int h);
01287
01301 void sceGuViewport(int cx, int cy, int width, int height);
01302
01312 void sceGuDrawBezier(int vtype, int ucount, int vcount, const void* indices, const void* vertices);
01313
01314 void sceGuPatchDivide(unsigned int a0, unsigned int a1);
01315 void sceGuPatchFrontFace(unsigned int a0);
01316 void sceGuPatchPrim(unsigned int a0);
01317
01318 void sceGuDrawSpline(int vtype, int ucount, int vcount, int uedge, int vedge, const void* indices, const void* vertices);
01319
01332 void sceGuSetMatrix(int type, const ScePspFMatrix4* matrix);
01333
01347 void sceGuBoneMatrix(unsigned int index, const ScePspFMatrix4* matrix);
01348
01362 void sceGuMorphWeight(int index, float weight);
01363
01364 void sceGuDrawArrayN(int primitive_type, int vertex_type, int count, int a3, const void* indices, const void* vertices);
01365
01376 void guSwapBuffersBehaviour(int behaviour);
01377
01399 void guSwapBuffersCallback(GuSwapBuffersCallback callback);
01400
01403 #if defined(__cplusplus)
01404 };
01405 #endif
01406
01407 #endif